package com.you.open.api.demo.config;

import com.yough.api.framework.core.parse.DocumentParser;
import com.yough.api.framework.core.parse.helper.JarDocumentParserHelper;
import org.springframework.context.annotation.Configuration;

/**
 * @Description
 * @Author yough
 * @Version V1.0.0
 * @Since 1.0
 * @Date 2021/1/13
 */
@Configuration
public class ApiFrameworkConfig {

    public void parseJarFile(String sysNo, String jarFilePath) throws Exception {
        DocumentParser documentParser = new DocumentParser();
        // 使用jar包文档解析辅助类
        JarDocumentParserHelper jarDocumentParserHelper = new JarDocumentParserHelper();
        jarDocumentParserHelper.setSysNo(sysNo);
        // 设置文档解析器
        documentParser.setDocumentParser(jarDocumentParserHelper);
        // 解析文档，生成api文档
        documentParser.parseDocument(jarFilePath);
    }
}
